<HTML><HEAD><TITLE>get_prompt(+InStream, -Prompt, -OutStream)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">Obsolete</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>get_prompt(+InStream, -Prompt, -OutStream)</H1>
Succeeds if the prompt for the stream InStream is Prompt and is written to
the stream OutStream.


<DL>
<DT><EM>InStream</EM></DT>
<DD>Integer (stream number) or Atom (reserved or user-defined                symbolic stream name).
</DD>
<DT><EM>Prompt</EM></DT>
<DD>String, atom or variable.
</DD>
<DT><EM>OutStream</EM></DT>
<DD>Variable,Integer or Atom.
</DD>
</DL>
<H3>This built-in predicate is obsolete!</H3>
<H2>Description</H2>
   Used to get the prompt Prompt of the input stream InStream which is
   output to the stream OutStream.

<P>
   When new data is to be read from an input stream, the system prints on
   the specified output stream a prompt, to notify the user.

<P>
   InStream (and OutStream, when instantiated) can be a symbolic stream name
   (atom) or a physical stream number (integer).  InStream must be an
   existing stream open in read or update mode.  OutStream must be open in
   write or update mode.

<P>
   Note that the prompt for toplevel-input printed by the system at the end
   of each query is made using the predicate toplevel-prompt/1 and not by
   using the string set by set_prompt/3.

<P>

<H3>Modes and Determinism</H3><UL>
<LI>get_prompt(+, -, -) is det
</UL>
<H3>Exceptions</H3>
<DL>
<DT><EM>(4) instantiation fault </EM>
<DD>InStream is not instantiated.
<DT><EM>(5) type error </EM>
<DD>Either InStream or OutStream (or both) is instantiated, but    is neither an atom nor an integer.
<DT><EM>(5) type error </EM>
<DD>Prompt is instantiated, but to neither an atom nor a string.
<DT><EM>(192) illegal stream mode </EM>
<DD>InStream is not an input stream.
<DT><EM>(192) illegal stream mode </EM>
<DD>OutStream is not an output stream.
<DT><EM>(193) illegal stream specification </EM>
<DD>Either InStream or OutStream is an illegal stream    specification (e.g.  does not exist).
</DL>
<H2>Examples</H2>
<PRE>
Success:
    [eclipse]: get_prompt(debug_input,_,input),% find where the
                                             % prompt is output;
    &gt; set_prompt(debug_input,"&gt; ",input).    % change it
    yes.                                     % destructively.

    [eclipse]: read(X).
    &gt; a.
    X = a
    yes.
    [eclipse]: get_prompt(input, Old, Out),
    &gt; set_prompt(input, "Enter a term: ", Out), read(X).
    Enter a term: a.
    Old = "&gt; "
    Out = 1
    X = a
    yes.

    [eclipse]: get_stream(debug_input,S), % debug input prompt
    &gt; set_prompt(S, " DEBUG: ", 1).
    S = 3
    yes.
    [eclipse]: trace.
    yes.
    [eclipse]: atom_string(atom, String).
    B (1) 0  CALL   atom_string(atom, _g52) DEBUG: creep
    B (1) 0  EXIT   atom_string(atom, "atom") DEBUG: creep
    String = "atom"
    yes.

Fail:
    get_prompt(0,"",S).

Error:
    get_prompt(I, "p", Stream).  (Error 4).
    get_prompt(0, Prompt, "5").  (Error 5).
    get_prompt(1, Prompt, 2).    (Error 192). % 1 in write mode
    get_prompt(0, Prompt, 30).   (Error 193). % no such stream



</PRE>
<H2>See Also</H2>
<A HREF="../../kernel/obsolete/set_prompt-3.html">set_prompt / 3</A>, <A HREF="../../kernel/iostream/get_stream_info-3.html">get_stream_info / 3</A>
</BODY></HTML>
